package MyGO.utils.enumerastion;
public enum Settlement {
    CASH,  // 现金
    CREDITCARD,  // 信用卡
    MEDICALINSURANCECARD;  // 医保卡

    @Override
    public String toString() {
        return switch (this) {
            case CASH -> "现金";
            case CREDITCARD -> "信用卡";
            case MEDICALINSURANCECARD -> "医保卡";
        };
    }

    public static Settlement parseSettlementType(String settlement) {
        return switch (settlement) {
            case "现金" -> CASH;
            case "信用卡" -> CREDITCARD;
            case "医保卡" -> MEDICALINSURANCECARD;
            default -> null;
        };
    }
}
